"use strict"
//DEVELOP开发工具接口
//branch列表
module.exports = function(){
    this.output = 'json';
    let result = { "name":this.session.get("name"),"level":this.session.get("level"),"branch":{}};
    let authorize = this.model.admin("authorize");
    return authorize.branch(this.session.uid,result['level']).then(ret=>{
        result['branch'] = ret||{};
        return result;
    })
}



//1.1开发工具初始化信息，opensdk
module.exports.developNew = function(){
    this.output = 'json';
    let branch = this.get("branch","string");
    if(!branch){
        return this.error("branch empty")
    }
    let opensdk = this.model("branch/opensdk/",branch);
    return opensdk.mget(["_id","key","name"]).then(ret=>{
        return {"opensdk":ret};
    })
}